package com.powersi.hygeia.framework.jdbclogger.formatters;

import java.sql.Blob;
import java.sql.SQLException;

/**
 * @author Sorin Silaghi (latest modification by $Author: sorin7486 $)
 * @version $Revision: 115 $ $Date: 2007-07-19 11:41:41 +0200 (Thu, 19 Jul 2007) $
 */
public class BlobParameterFormatterImpl implements ParameterFormatter {

    public Class getFormattingClass() {
        return Blob.class;
    }

    public String format(Object paramObj) {
        if (paramObj == null)
            return "null";

        try {
            return "Blob size:" + ((Blob) paramObj).length();
        } catch (SQLException e) {
            return "ERROR - Could not read blob size!";
        }
    }
}
